home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
dlg
/
cronshell11.lha
/
CronShell.doc
< prev
Wrap
Text File
|
1994-09-20
|
4KB
|
104 lines
CronShell is a DLG/TpTCron utility that allows you to run a program
as though it had been run in the TpTCron environment, without losing
the current directory and without running asynchronously (i.e. it
waits for the program to finish running under TpTCron before
returning control).
It is a TOTAL hack! Though it should be a "well-behaved" hack.
THE USER (you) ASSUMES ALL RESPONSIBILITY FOR THE USE OF THIS
PROGRAM. THE AUTHOR (me) SHALL NOT BE IN ANY WAY LIABLE FOR
ANY DAMAGES BELIEVED TO BE CONNECTED WITH THE USE OF THIS PROGRAM!
If you have any questions, e-mail leon@mtu.edu
or on fidonet: leon @ 1:139/950.0
VERSION 1.1 uses a write-lock instead of a read-lock. The
read-lock would return after about 20 seconds. The write-lock
waits until the pending program has actually completed, which
is what needs to happen for CronShell to be even remotely
reliable.
------------------------------------------------------------------
USAGE: CronShell <LOCKNAME> <COMAND + ARGS>
It requires a lockname, which must be unique and no other process in the
system should attempt to use the same name. Locknames can be just about
any string that does not contain ":" or "/" and only the first 20 characters
are relevant.
The command part should contain exactly what you would normally
use to run the desired command.
WHY write such a silly program?
SIMPLE, to get around a bug in PDQ/DLGMail.
The environment that PDQ/DLGMail uses to execute commands is severely
broken. Which means that depending on what version of the OS you
are running, a lot of commands fail to run properly when invoked
under PDQ/DLGMail. In specific, the newer versions of UnZIP, which
are required for mail packets archived with PkZIP2.04g will not work
with PDQ/DLGMail (at least not on my system). To make matters worse,
PDQ/DLGMail doesn't even know that the command failed, so it happily
removes your incoming mail for you even though it wasn't successfully
processed. OUCH!
The fix is to change your ZIPEXTRACT configuration to something like:
ZIPEXTRACT Fido:CronShell PDQMail_ZIP C:UnZIP %s *.PKT
^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
/ \
just my attempt actual command to run.
at using a
descriptive
lockname.
The above line allows me to process incoming .ZIP packets unless
something goes wrong.
WHAT CAN GO WRONG?
PDQ/DLGMail has no idea if the extraction actually worked properly--
that's okay, it didn't have any idea before, either. But at least
this way, barring a full-disk or lack of memory or some other
(hopefully) avoidable catastrophe, you'll still get your mail.
HOW DOES IT WORK?
I'm going to tell you exactly what I've done so that you can hopefully
avoid unnecessary unpredictable behavior.
CronShell uses the specified lockname to do the equivalent of
DLG:GetResource -n lockname -k CronShell
(create T:C_lockname_EXE, which contains:
CD <current directory where program is to be run>
<command to run>
DLG:FreeResource -n lockname -k CronShell
)
DLG:CronEvent ADD 0 Execute T:C_lockname_EXE
DLG:GetResource -n lockname -k CronShell
(delete T:C_lockname_EXE)
DLG:FreeResource -n lockname -k CronShell
....
So, QUITE CLEARLY it is a hack.... But it works.
Most complications will arise from lockname conflicts, which are not only
necessary for the DLG resource locking, but also for the temporary
shell script naming.
CronShell also has other applications, and I'm sure you can think
of at least one. ;)
Enjoy!
\Leon
______________________________________________________________________
| o__ ---- \\ABCD///Amiga BitSwap Central Dispatch - DLG BB/OS!
| _.>/ _------- \\BBS// 28K8bps USR V.FC/34 Fido/UUCP(906)482-8248
|(_) \(_)Leon Shaner\\\// <leon@abcd.houghton.mi.us> or <leon@mtu.edu>
|________[MTU - CTS] \\/ ...Non-Conformity is a virtue I hold dear...